<!DOCTYPE html>

<html lang="en" data-content_root="../../">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>Writing and running your code &#8212; Pytch  documentation</title>
    <link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
    <link rel="stylesheet" type="text/css" href="../../_static/classic.css?v=36340f97" />
    <link rel="stylesheet" type="text/css" href="../../_static/css/pytch-classic.css?v=0321735e" />
    
    <script src="../../_static/documentation_options.js?v=7f41d439"></script>
    <script src="../../_static/doctools.js?v=9bcbadda"></script>
    <script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
    
    <link rel="icon" href="../../_static/favicon.ico"/>
    <link rel="author" title="About these documents" href="../../about.html" />
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="Running your project" href="running-your-program.html" />
    <link rel="prev" title="Following a tutorial" href="tutorials.html" /> 
  </head><body>
<div class="NavBar">
  <a href="../../../app/"><h1>Pytch</h1></a>
  <ul>
    <a href="https://pytch.scss.tcd.ie/"><li>About Pytch</li></a>
    <a href="../../index.html"><li>Help</li></a>
    <a href="../../../app/tutorials/"><li>Tutorials</li></a>
    <a href="../../../app/my-projects/"><li>My projects</li></a>
  </ul>
</div>
<div class="warning-work-in-progress">
  <p>These help pages are incomplete — we are working on it!</p>
</div>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="writing-and-running-your-code">
<h1>Writing and running your code<a class="headerlink" href="#writing-and-running-your-code" title="Link to this heading">¶</a></h1>
<p>In Pytch, you describe what you want the Sprites in your project to do
by writing Python code.</p>
<p>You write and edit your Python program in the top-left panel.  Unlike
Scratch, where changes take effect straight away, in Python there is
the idea of <em>starting your program</em>.  (TODO: Settle on a good word for
this.  “Launch”?)</p>
<p>To start your program, click the green flag.  If there are errors in
your program which mean it can’t start, a description of the problem
will appear in the ‘Errors’ tab of the information pane.  If there are
no errors, the “green flag” event happens, which your Sprites can
respond to if they need to, for example, move to their starting
position.</p>
<p>It is a good idea to save your project’s code often, with the <em>Save</em>
button above the stage.  It is highlighted when there are unsaved
changes in your program.</p>
<p>TODO: Fill in structure of below.</p>
<ul class="simple">
<li><p>The <em>code editor</em> is what Pytch has instead of Scratch’s scripts area</p></li>
<li><p>Python uses indentation as part of what your code means; the editor
will help you with this</p></li>
<li><p>The code is part of your project; you have to <em>SAVE</em> it to avoid
losing work; this happens every time you <em>green-flag</em> as well</p></li>
<li><p>See also <a class="reference internal" href="running-your-program.html"><span class="doc">Running your project</span></a></p></li>
</ul>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="Main">
        <div class="sphinxsidebarwrapper"><ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Using the Pytch web app</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="interface.html">The Pytch web app</a></li>
<li class="toctree-l2"><a class="reference internal" href="tutorials.html">Following a tutorial</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Writing and running your code</a></li>
<li class="toctree-l2"><a class="reference internal" href="running-your-program.html">Running your project</a></li>
<li class="toctree-l2"><a class="reference internal" href="graphics-and-sounds.html">Graphics and sounds</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../medialib/user/index.html">The Pytch media library</a></li>
<li class="toctree-l2"><a class="reference internal" href="printing-output.html">Printing output from your project</a></li>
<li class="toctree-l2"><a class="reference internal" href="errors-and-debugging.html">Errors in Pytch projects</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#privacy">Privacy</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../vm/user/index.html">Writing Pytch programs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../about.html">About Pytch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../contact.html">Contact</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../developer.html">Developer documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../legal/index.html">Legal information</a></li>
</ul>
<div class="docs-home-link"><hr>
  <ul>
    <li>
      <a href="../../index.html">Pytch help home</a>
    <li>
  </ul>
</div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
  </body>
</html>